//
//  SearchView.m
//  Coco_Music
//
//  Created by K。 on 15/6/19.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "SearchView.h"



@implementation SearchView


-(void)dealloc
{
    [_SearchTextField release];
    [super dealloc];
}


-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}
-(void)createSubViews
{
    self.SearchTextField =[[UITextField alloc]initWithFrame:CGRectMake([UIScreen mainScreen].bounds.origin.x+10, [UIScreen mainScreen].bounds.origin.y+15,[UIScreen mainScreen].bounds.size.width-20, 40)];
    self.SearchTextField.textColor = [UIColor blueColor];
    self.SearchTextField.placeholder =  @"歌曲/歌手/专辑/歌词/歌单";
    self.SearchTextField.borderStyle =UITextBorderStyleRoundedRect;
    self.SearchTextField.delegate= self;
    self.SearchTextField.layer.contentsScale = 1;
    self.SearchTextField.returnKeyType = UIReturnKeySearch;
    [self addSubview:self.SearchTextField];
    [_SearchTextField release];
    
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    if ([textField.text isEqualToString:@""]) {
        
    }
    else
    {
        [self.Mypresent PresentDetailView];
    }
    [self.SearchTextField resignFirstResponder];
    return YES;
}
@end
